
//es6支持 在对象中还可以用中括号的形式定义方法名
//定义store的事件类型并修改数据源
//不使用辅助函数直接提交修改状态this.$store.commit('singer')
//使用辅助函数在methods里先映射 然后提交修改状态this.singer()
//必须同步 
//同步的意义在于这样每一个 mutation 执行完成后都可以对应到一个新的状态
//这样devtools就可以打个 snapshot 存下来 需要在actions里面进行异步封装 mutation来实现异步
import * as types from './mutation-types'
const mutations = {
    [types.SET_SINGER](state,singer){
        state.singer=singer
    },
    [types.SET_PALYING](state,flag){
        state.playing=flag
    },
    [types.SET_FULL_SCREEN](state,flag){
        state.fullScreen=flag
    },
    [types.SET_PLAYLIST](state,list){
        state.playList=list
    },
    [types.SET_SEQUENCELSIT](state,list){
        state.sequenceList=list
    },
    [types.SET_PLAY_MODE](state,mode){
        state.mode=mode
    },
    [types.SET_CURRENT_INDEX](state,index){
        state.currentIndex=index
    },
    [types.SET_DISC](state,disc){
        state.disc=disc
    },
    [types.SET_TOPLIST](state,toplist){
        state.toplist=toplist
    },
    [types.SET_SEARCH_HISTORY](state,history){
        state.searchHistory=history
    },
    [types.SET_PLAY_HISTORY](state,history){
        state.playHistory=history
    },
    [types.SET_FAVORITE_LIST](state,history){
        state.favoriteList=history
    }
} 
export default mutations